package com.why.zing.payapi.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.math.BigDecimal;

/**
 * 创建支付订单
 *
 * @author 王洪玉
 * @date 2020/1/12
 */

@Data
@ApiModel(value = "支付订单信息")
public class PayOrderRequest {

    @NotBlank
    @ApiModelProperty(value = "业务方支付单号")
    private String businessOrderNo;

    @NotBlank
    @Pattern(regexp = "[\\u4e00-\\u9fa5\\w]{1,50}", message = "订单描述内容格式错误,只支持汉字，下划线，数字，字母,长度最小为1，最大为50")
    @ApiModelProperty(value = "交易名称")
    private String tradeName;

    @NotBlank
    @Length(max = 100)
    @ApiModelProperty(value = "交易描述")
    private String tradeDesc;

    @NotNull
    @ApiModelProperty(value = "订单总金额")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "过期时间，单位分钟，默认半个小时")
    private Integer expireTime;

    @ApiModelProperty(value = "接口通知回调URL")
    private String callbackUrl;

}
